package com.cn.service.server.Equipment.Impl;

import com.cn.bean.pojo.PartsManagement.TeamPersonnelMapping;
import com.cn.bean.pojo.bc.User;
import com.cn.bean.pojo.lbj.ComponentSingleRegistrationTable;
import com.cn.bean.pojo.workOrder.BusinessItemWorkOrderPool;
import com.cn.bean.pojo.workOrder.WorkOrderPlanMainTable;
import com.cn.bean.pojo.workOrder.WorkOrderPlanSubTable;
import com.cn.mapper.dao.db5.Equipment.WorkOrderPlanDao;
import com.cn.service.server.Equipment.WorkOrderPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WorkOrderPlanServiceImpl implements WorkOrderPlanService {
    @Autowired(required = false)
    private WorkOrderPlanDao workOrderPlanDao;
    @Override
    public List<WorkOrderPlanMainTable> selectWorkOrderPlan(WorkOrderPlanMainTable workOrderPlanMainTable) {
        return workOrderPlanDao.selectWorkOrderPlan(workOrderPlanMainTable);
    }

    @Override
    public List<WorkOrderPlanMainTable> selectWorkOrderPlanAll(WorkOrderPlanMainTable workOrderPlanMainTable) {
        return workOrderPlanDao.selectWorkOrderPlanAll(workOrderPlanMainTable);
    }

    @Override
    public List<WorkOrderPlanSubTable> selectWorkOrderPlanSub(WorkOrderPlanSubTable workOrderPlanSubTable) {
        return workOrderPlanDao.selectWorkOrderPlanSub(workOrderPlanSubTable);
    }

    @Override
    public List<BusinessItemWorkOrderPool> selectWorkOrderPool(BusinessItemWorkOrderPool businessItemWorkOrderPool) {
        return workOrderPlanDao.selectWorkOrderPool(businessItemWorkOrderPool);
    }

    @Override
    public List<User> selectUser(User user) {
        return workOrderPlanDao.selectUser(user);
    }

    @Override
    public List<TeamPersonnelMapping> selectWorkTeam(TeamPersonnelMapping teamPersonnelMapping) {
        return workOrderPlanDao.selectWorkTeam(teamPersonnelMapping);
    }

    @Override
    public int insertWorkOrderPlan(WorkOrderPlanMainTable workOrderPlanMainTable) {
        Boolean a=workOrderPlanDao.insertWorkOrderPlan(workOrderPlanMainTable);
        if(a){
            return 1;
        }
        return 0;
    }

    @Override
    public int insertWorkOrderPlanSub(WorkOrderPlanSubTable workOrderPlanSubTable) {
        Boolean b=workOrderPlanDao.insertWorkOrderPlanSub(workOrderPlanSubTable);
        if(b){
            return 1;
        }
        return 0;
    }

    @Override
    public int insertWorkOrderPool(BusinessItemWorkOrderPool workOrderPool) {
        Boolean c=workOrderPlanDao.insertWorkOrderPool(workOrderPool);
        if(c){
            return 1;
        }
        return 0;
    }

    @Override
    public int updateWorkOrderAudit(int id) {
        Boolean d=workOrderPlanDao.updateWorkOrderAudit(id);
        if(d){
            return 1;
        }
        return 0;
    }

    @Override
    public int delWorkOrderAudit(int id) {
        Boolean x=workOrderPlanDao.delWorkOrderAudit(id);
        if(x){
            return 1;
        }
        return 0;
    }

    @Override
    public int lockWorkOrder(ComponentSingleRegistrationTable componentSingleRegistrationTable) {
        Boolean z=workOrderPlanDao.lockWorkOrder(componentSingleRegistrationTable);
        if(z){
            return 1;
        }
        return 0;
    }

    @Override
    public int openWorkOrder(String uniqueCode) {
        Boolean u=workOrderPlanDao.openWorkOrder(uniqueCode);
        if (u){
            return 1;
        }
        return 0;
    }

    @Override
    public Integer getWorkOrderPlanMainAutoid() {
        return workOrderPlanDao.getWorkOrderPlanMainAutoid();
    }

    @Override
    public Integer getWorkOrderPlanSubAutoid() {
        return workOrderPlanDao.getWorkOrderPlanSubAutoid();
    }

    @Override
    public Integer getWorkOrderPoolAutoid() {
        return workOrderPlanDao.getWorkOrderPoolAutoid();
    }

    @Override
    public List<BusinessItemWorkOrderPool> selectBusinessItemWorkOrderPool(String workOrderCode, int page, int limit) {
        return workOrderPlanDao.selectBusinessItemWorkOrderPool(workOrderCode,page,limit);
    }

    @Override
    public List<BusinessItemWorkOrderPool> selectBusinessItemWorkOrderPoolId(int id) {
        return workOrderPlanDao.selectBusinessItemWorkOrderPoolId(id);
    }

    @Override
    public List<WorkOrderPlanSubTable> selectWorkOrderPlanSubTable(int mid) {
        return workOrderPlanDao.selectWorkOrderPlanSubTable(mid);
    }
}
